<?php

namespace App\serve;

use App\Model\UserModel;
use Hyperf\Di\Annotation\Inject;

class UserServe extends CommonServe
{

    #[Inject]
    public UserModel $userModel;


    /**
     * @param int $id
     * @return \Hyperf\Database\Model\Builder|\Hyperf\Database\Model\Builder[]|\Hyperf\Database\Model\Collection|\Hyperf\Database\Model\Model|null
     */
    public function user(int $id)
    {
       return $this->userModel::query()->find($id);
    }


    /**
     * @return \Hyperf\Database\Model\Builder[]|\Hyperf\Database\Model\Collection
     */
    public function userList()
    {
        return $this->userModel::query()->get();
    }

}